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

C++ AnscEqualString函数代码示例

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

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



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

示例1: CosaDmlUpnpDevEnable

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Device_SetParamBoolValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                BOOL                        bValue
            );

    description:

        This function is called to set BOOL parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                BOOL                        bValue
                The updated BOOL value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Device_SetParamBoolValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        BOOL                        bValue
    )
{
    PCOSA_DATAMODEL_UPNP            pMyObject    = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp;
    
    /* check the parameter name and set the corresponding value */
    if( AnscEqualString(ParamName, "Enable", TRUE))
    {
        /* save update to backup */
        pMyObject->bUpnpDevEnable = bValue;
        CosaDmlUpnpDevEnable(NULL, pMyObject->bUpnpDevEnable);

        return TRUE;
    }

    if( AnscEqualString(ParamName, "UPnPIGD", TRUE))
    {
        /* save update to backup */
        pMyObject->bUpnpDevIgdEnable = bValue;
        CosaDmlUpnpDevEnableIgd(NULL, pMyObject->bUpnpDevIgdEnable);

        return TRUE;
    }


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


示例2:

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Device_GetParamBoolValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                BOOL*                       pBool
            );

    description:

        This function is called to retrieve Boolean parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                BOOL*                       pBool
                The buffer of returned boolean value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Device_GetParamBoolValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        BOOL*                       pBool
    )
{
    PCOSA_DATAMODEL_UPNP            pMyObject    = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp;
    
    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "Enable", TRUE))
    {
        /* collect value */
        *pBool = pMyObject->bUpnpDevEnable;
        return TRUE;
    }

    if( AnscEqualString(ParamName, "UPnPIGD", TRUE))
    {
        /* collect value */
        *pBool = pMyObject->bUpnpDevIgdEnable;
        return TRUE;
    }


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


示例3: CosaDmlUpnpDevGetAdvPeriod

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Device_GetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG*                      puLong
            );

    description:

        This function is called to retrieve ULONG parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG*                      puLong
                The buffer of returned ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Device_GetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG*                      puLong
    )
{
    PCOSA_DATAMODEL_UPNP            pMyObject    = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp;

    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_AdvertisementPeriod", TRUE) )
    {
        /* collect value */
        CosaDmlUpnpDevGetAdvPeriod(NULL, &pMyObject->AdvertisementPeriod);
        
        *puLong = pMyObject->AdvertisementPeriod;

        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_TTL", TRUE) )
    {
        /* collect value */
        CosaDmlUpnpDevGetTTL(NULL, &pMyObject->TTL);
        
        *puLong = pMyObject->TTL;

        return TRUE;
    }

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


示例4:

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Time_SetParamBoolValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                BOOL                        bValue
            );

    description:

        This function is called to set BOOL parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                BOOL                        bValue
                The updated BOOL value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Time_SetParamBoolValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        BOOL                        bValue
    )
{
    PCOSA_DATAMODEL_TIME            pMyObject = (PCOSA_DATAMODEL_TIME)g_pCosaBEManager->hTime;

    /* check the parameter name and set the corresponding value */
    if( AnscEqualString(ParamName, "Enable", TRUE))
    {
        /* save update to backup */
        pMyObject->TimeCfg.bEnabled = bValue;
        return TRUE;
    }

    if( AnscEqualString(ParamName, "DaylightSaving", TRUE))
    {
        /* save update to backup */
        pMyObject->TimeCfg.bDaylightSaving = bValue;
        return TRUE;
    }

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


示例5: CosaDmlTimeGetState

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Time_GetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG*                      puLong
            );

    description:

        This function is called to retrieve ULONG parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG*                      puLong
                The buffer of returned ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Time_GetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG*                      puLong
    )
{
    PCOSA_DATAMODEL_TIME            pMyObject = (PCOSA_DATAMODEL_TIME)g_pCosaBEManager->hTime;
    
    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "Status", TRUE))
    {
        /* collect value */
        CosaDmlTimeGetState(NULL, &pMyObject->TimeStatus, &pMyObject->CurrLocalTime);
        *puLong = pMyObject->TimeStatus;
        return TRUE;
    }

    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "CityIndex", TRUE))
    {
        /* collect value */
        *puLong = pMyObject->TimeCfg.cityIndex;
        return TRUE;
    }

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


示例6:

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

    caller:     owner of this object 

    prototype: 

        BOOL
        MemoryStatus_GetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG*                      puLong
            );

    description:

        This function is called to retrieve ULONG parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG*                      puLong
                The buffer of returned ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
MemoryStatus_GetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG*                      puLong
    )
{
    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "Total", TRUE))
    {
         /* collect value */
        *puLong = COSADmlGetMemoryStatus(ParamName);
        return TRUE;
    }

    if( AnscEqualString(ParamName, "Free", TRUE))
    {
        /* collect value */
        *puLong = COSADmlGetMemoryStatus(ParamName);
        return TRUE;
    }


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


示例7: CosaDmlUpnpDevSetAdvPeriod

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Device_SetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG                       uValue
            );

    description:

        This function is called to set ULONG parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG                       uValue
                The updated ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Device_SetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG                       uValue
    )
{
    PCOSA_DATAMODEL_UPNP            pMyObject    = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp;

    /* check the parameter name and set the corresponding value */
    if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_AdvertisementPeriod", TRUE) )
    {
        /* save update to backup */
        pMyObject->AdvertisementPeriod = uValue;
        CosaDmlUpnpDevSetAdvPeriod(NULL, pMyObject->AdvertisementPeriod);
        
        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_TTL", TRUE) )
    {
        /* save update to backup */
        pMyObject->TTL = uValue;
        CosaDmlUpnpDevSetTTL(NULL, pMyObject->TTL);
        
        return TRUE;
    }

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


示例8: if

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

    caller:     owner of this object

    prototype:

        ANSC_STATUS
        CcspCwmpsoSaveCwmpEvent
            (
                ANSC_HANDLE                 hThisObject
            );

    description:

        This function is called to save Cwmp Events before reboot

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

    return:     status of operation.

**********************************************************************/
BOOL
CcspCwmpIsUndiscardedEvent
    (
        char*                       eventName
    )
{
    /*
     *  According to WT151, the events "2 PERIODIC", "3 SCHEDULED", "7 TRANSFERCOMPLETE"
     *  and the ones start with "M" won't be discarded
     */
    if( AnscEqualString(eventName, CCSP_CWMP_INFORM_EVENT_NAME_Peroidic, TRUE))
    {
        return TRUE;
    }
    else if( AnscEqualString(eventName, CCSP_CWMP_INFORM_EVENT_NAME_Scheduled, TRUE))
    {
        return TRUE;
    }
    else if( AnscEqualString(eventName, CCSP_CWMP_INFORM_EVENT_NAME_TransferComplete, TRUE))
    {
        return TRUE;
    }
    else if( eventName[0] == 'M')
    {
        return TRUE;
    }

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


示例9:

BOOL ANSC_EXPORT_API
COSA_IsObjSupported
    (
        char*                        pObjName
    )
{
    /* COSA XML file will be generated based on standard TR-xxx data model definition.
     * By default, all the objects are expected to supported in the libraray. 
     * Realistically, we will have certain ones cannot be supported at the early stage of development.
     * We can rule them out by return FALSE even if they're defined in COSA XML file.
     */

#if 0 

    if( AnscEqualString(pObjName, "InternetGatewayDevice.UserInterface.",TRUE))
    {
        /* all the objects/parameters under "UserInterface" will not be populated in Data Model Tree. */
        return FALSE;
    }

#endif

#if (defined(_COSA_DRG_CNS_))

    if(AnscEqualString(pObjName, "Device.DNS.Client.", TRUE))
    {
        return FALSE;
    }        

#endif

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


示例10:

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Host_GetParamBoolValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                BOOL*                       pBool
            );

    description:

        This function is called to retrieve Boolean parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                BOOL*                       pBool
                The buffer of returned boolean value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Host_GetParamBoolValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        BOOL*                       pBool
    )
{
    //printf("Host_GetParamBoolValue %p, %s\n", hInsContext, ParamName);
    PLmObjectHost pHost = (PLmObjectHost) hInsContext;
    int i = 0;
    for(; i<LM_HOST_NumBoolPara; i++){
        if( AnscEqualString(ParamName, lmHosts.pHostBoolParaName[i], TRUE))
        {
            /* collect value */
            *pBool = pHost->bBoolParaValue[i];
            return TRUE;
        }
    }

    if( AnscEqualString(ParamName, "X_CISCO_COM_TrueStaticIPClient", TRUE))
    {
        /* collect value */
        *pBool = pHost->bTrueStaticIPClient;
        return TRUE;
    }

    /* AnscTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */
    return FALSE;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:60,代码来源:cosa_hosts_dml.c


示例11: IPv6rdIF_GetParamBoolValue

BOOL
IPv6rdIF_GetParamBoolValue(
        ANSC_HANDLE hInsContext, 
        char *ParamName, 
        BOOL *pBool)
{
    PCOSA_CONTEXT_LINK_OBJECT       pLinkObject = (PCOSA_CONTEXT_LINK_OBJECT)hInsContext;
    PCOSA_DML_IPV6RD_IF             pEntry = (PCOSA_DML_IPV6RD_IF)pLinkObject->hContext;

    if (!pLinkObject || !pEntry)
        return FALSE;

    CosaDml_IPv6rdGetEntry(NULL, pEntry->InstanceNumber, pEntry);

    if (AnscEqualString(ParamName, "Enable", TRUE))
    {
        *pBool = pEntry->Enable;
        return TRUE;
    }
    else if (AnscEqualString(ParamName, "AllTrafficToBorderRelay", TRUE))
    {
        *pBool = pEntry->AllTrafficToBorderRelay;
        return TRUE;
    }

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


示例12: CcspLMLiteConsoleTrace

BOOL
NetworkDevicesTraffic_Default_GetParamUlongValue
    (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG*                      puLong
    )
{
    CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ENTER \n", __FUNCTION__ ));

    if ( AnscEqualString(ParamName, "PollingPeriod", TRUE))
    {
        *puLong =  GetNDTPollingPeriodDefault();
        CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, *puLong ));
        return TRUE;
    }

    if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE))
    {
        *puLong =  GetNDTReportingPeriodDefault();
        CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, *puLong ));
        return TRUE;
    }

    if ( AnscEqualString(ParamName, "OverrideTTL", TRUE))
    {
        *puLong =  GetNDTOverrideTTLDefault();
        CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, *puLong ));
        return TRUE;
    }

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

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


示例13: sizeof

BOOL
ConnectivityTest_GetParamIntValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        int*                        pInt
    )
{
    PCOSA_DATAMODEL_SELFHEAL            pMyObject           = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal;

    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_RebootInterval", TRUE))
    {
        /* collect value */
	   *pInt = pMyObject->pConnTest->RouterRebootInterval ;
	   return TRUE;
    }

    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_CurrentCount", TRUE))
    {
        /* collect value */
        char buf[16]={0};
        syscfg_get( NULL, "todays_reset_count", buf, sizeof(buf));
        if( buf[0] != '\0' )
        {
                    *pInt = atoi(buf);
                     return TRUE;
        }
    }
    
    return FALSE;
}
开发者ID:rdkcmf,项目名称:rdkb-TestAndDiagnostic,代码行数:31,代码来源:cosa_selfheal_dml.c


示例14:

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

    caller:     owner of this object

    prototype

        BOOL
        ResourceMonitor_GetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG*                      puLong
            );

    description:

        This function is called to retrieve ULONG parameter value;

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG*                      puLong
                The buffer of returned ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
ResourceMonitor_GetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG*                      puLong
    )
{
    PCOSA_DATAMODEL_SELFHEAL            pMyObject    = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; 
    PCOSA_DML_RESOUCE_MONITOR           pRescMonitor = pMyObject->pResMonitor;
    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_UsageComputeWindow", TRUE))
    {
        *puLong = pRescMonitor->MonIntervalTime;
        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AvgCPUThreshold", TRUE))
    {
        *puLong = pRescMonitor->AvgCpuThreshold;
        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AvgMemoryThreshold", TRUE))
    {
        *puLong = pRescMonitor->AvgMemThreshold;
        return TRUE;
    }
    return FALSE;
}
开发者ID:rdkcmf,项目名称:rdkb-TestAndDiagnostic,代码行数:59,代码来源:cosa_selfheal_dml.c


示例15: IPv6rdIF_SetParamBoolValue

BOOL
IPv6rdIF_SetParamBoolValue(
        ANSC_HANDLE hInsContext,
        char        *ParamName,
        BOOL        bValue
        )
{
    PCOSA_CONTEXT_LINK_OBJECT       pLinkObject = (PCOSA_CONTEXT_LINK_OBJECT)hInsContext;
    PCOSA_DML_IPV6RD_IF             pEntry = (PCOSA_DML_IPV6RD_IF)pLinkObject->hContext;

    if (!pLinkObject || !pEntry)
        return FALSE;

    if (AnscEqualString(ParamName, "Enable", TRUE))
    {
        pEntry->Enable = bValue;
        return TRUE;
    }
    else if (AnscEqualString(ParamName, "AllTrafficToBorderRelay", TRUE))
    {
        pEntry->AllTrafficToBorderRelay = bValue;
        return TRUE;
    }

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


示例16: if

BOOL
BwrmCpoMatchPath
    (
        ANSC_HANDLE                 hThisObject,
        char*                       root_path,
        char*                       page_path
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PBWRM_COOKED_PAGE_OBJECT        pMyObject    = (PBWRM_COOKED_PAGE_OBJECT)hThisObject;

    if ( !root_path || !page_path )
    {
        return  FALSE;
    }
    else if ( !pMyObject->RootPath || !pMyObject->PagePath )
    {
        return  FALSE;
    }
    else if ( !AnscEqualString(root_path, pMyObject->RootPath, FALSE) )
    {
        return  FALSE;
    }
    else if ( !AnscEqualString(page_path, pMyObject->PagePath, FALSE) )
    {
        return  FALSE;
    }

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


示例17: memset

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

    caller:     owner of this object

    prototype:

        BOOL
        SelfHeal_SetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG                       uValue
            );

    description:

        This function is called to set ULONG parameter value;

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG                       uValue
                The updated ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
SelfHeal_SetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG                       uValue
    )
{
    PCOSA_DATAMODEL_SELFHEAL            pMyObject    = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; 

    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_MaxRebootCount", TRUE))
    {
        if( pMyObject->MaxRebootCnt == uValue )
        {
            return TRUE;
		}
        char buf[8];
        memset(buf, 0, sizeof(buf));
        snprintf(buf,sizeof(buf),"%d",uValue);
        if (syscfg_set(NULL, "max_reboot_count", buf) != 0)
        {
			CcspTraceWarning(("%s: syscfg_set failed for %s\n", __FUNCTION__, ParamName));
			return FALSE;
        }
		if (syscfg_commit() != 0)
		{
            CcspTraceWarning(("%s: syscfg commit failed for %s\n", __FUNCTION__, ParamName));
			return FALSE;
		}
        pMyObject->MaxRebootCnt = uValue;
        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_MaxResetCount", TRUE))
    {
        if( pMyObject->MaxResetCnt == uValue )
        {
            return TRUE;
        }

        char buf[8];
        memset(buf, 0, sizeof(buf));
        snprintf(buf,sizeof(buf),"%d",uValue);
        if (syscfg_set(NULL, "max_reset_count", buf) != 0)
        {
            CcspTraceWarning(("%s: syscfg_set failed for %s\n", __FUNCTION__, ParamName));
            return FALSE;
        }
        if (syscfg_commit() != 0)
        {
            CcspTraceWarning(("%s: syscfg commit failed for %s\n", __FUNCTION__, ParamName));
            return FALSE;
        }
        pMyObject->MaxResetCnt = uValue;
        return TRUE;
    }

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


示例18: IPv6rdIF_SetParamStringValue

BOOL
IPv6rdIF_SetParamStringValue(
        ANSC_HANDLE hInsContext,
        char        *ParamName,
        char        *pString
        )
{
    PCOSA_CONTEXT_LINK_OBJECT       pLinkObject = (PCOSA_CONTEXT_LINK_OBJECT)hInsContext;
    PCOSA_DML_IPV6RD_IF             pEntry = (PCOSA_DML_IPV6RD_IF)pLinkObject->hContext;
    char v4addr[16];
    ULONG addlen;
    char tmp[128];

    if (!pLinkObject || !pEntry)
        return FALSE;

    if (AnscEqualString(ParamName, "Alias", TRUE))
    {
        AnscCopyString(pEntry->Alias, pString);
        return TRUE;
    }
    else if (AnscEqualString(ParamName, "BorderRelayIPv4Addresses", TRUE))
    {
        AnscCopyString(pEntry->BorderRelayIPv4Addr, pString);
        return TRUE;
    }
    else if (AnscEqualString(ParamName, "SPIPv6Prefix", TRUE))
    {
        AnscCopyString(pEntry->SPIPv6Prefix, pString);
        return TRUE;
    }
    else if (AnscEqualString(ParamName, "AddressSource", TRUE))
    {
        if (!pString || _ansc_strlen(pString) == 0)
        {
            AnscCopyString(pEntry->AddressSource, "");
            return TRUE;
        }

        addlen = sizeof(v4addr);
        _ansc_sprintf(tmp, "%sIPAddress", pString);
        if (g_GetParamValueString(g_pDslhDmlAgent, tmp, v4addr, &addlen) != 0)
        {
            CcspTraceWarning(("IPv6rdIF_SetParamStringValue: fail to get %s\n", tmp));
            return FALSE;
        }

        AnscCopyString(pEntry->AddressSource, v4addr);
        /* AnscCopyString(pEntry->AddressSource, pString); */
        return TRUE;
    }

    return FALSE;
}
开发者ID:davekimble,项目名称:CcspPandM,代码行数:54,代码来源:cosa_ipv6rd_dml.c


示例19: AnscEqualString

ANSC_STATUS
CcspCwmpsoDiscardCwmpEvent
    (
        ANSC_HANDLE                 hThisObject,
        int                         EventCode
    )
{
    PCCSP_CWMP_SESSION_OBJECT       pMyObject          = (PCCSP_CWMP_SESSION_OBJECT  )hThisObject;
    PCCSP_CWMP_EVENT                pCcspCwmpEvent     = (PCCSP_CWMP_EVENT           )NULL;
    ULONG                           i                  = 0;
    ULONG                           j                  = 0;

    /*
     * According to WT151, only the event "6 CONNECTIONREQUEST" must NOT retry delivery and it's a
     * single type event.
     *
     * Let's find and discard it;   
     */
    for( i = 0; i < pMyObject->EventCount; i ++)
    { 
        pCcspCwmpEvent = (PCCSP_CWMP_EVENT)pMyObject->EventArray[i];

        if ( ( EventCode == CCSP_CWMPSO_EVENTCODE_ConnectionRequest && 
             AnscEqualString(pCcspCwmpEvent->EventCode, CCSP_CWMP_INFORM_EVENT_NAME_ConnectionRequest, TRUE) ) ||
             ( EventCode == CCSP_CWMPSO_EVENTCODE_ValueChange && 
             AnscEqualString(pCcspCwmpEvent->EventCode, CCSP_CWMP_INFORM_EVENT_NAME_ValueChange, TRUE) ) )

        {
            if ( EventCode == CCSP_CWMPSO_EVENTCODE_ConnectionRequest )
            {
                CcspTr069PaTraceWarning(("Before the session retry, the event '%s' was discarded.\n", CCSP_CWMP_INFORM_EVENT_NAME_ConnectionRequest));
            }
            else
            {
                CcspTr069PaTraceWarning(("The event with code %d was discarded.\n", EventCode));
            }

            CcspCwmpFreeEvent(pCcspCwmpEvent);

            pMyObject->EventArray[i] = NULL;

            /* move the reminder event back */
            for( j = i; j < pMyObject->EventCount - 1; j ++)
            {
                pMyObject->EventArray[j] = pMyObject->EventArray[j + 1];
            }

            pMyObject->EventArray[pMyObject->EventCount - 1]  = NULL;
            pMyObject->EventCount --;
        }
    }

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


示例20: time

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

    caller:     owner of this object 

    prototype: 

        BOOL
        Host_GetParamUlongValue
            (
                ANSC_HANDLE                 hInsContext,
                char*                       ParamName,
                ULONG*                      puLong
            );

    description:

        This function is called to retrieve ULONG parameter value; 

    argument:   ANSC_HANDLE                 hInsContext,
                The instance handle;

                char*                       ParamName,
                The parameter name;

                ULONG*                      puLong
                The buffer of returned ULONG value;

    return:     TRUE if succeeded.

**********************************************************************/
BOOL
Host_GetParamUlongValue
    (
        ANSC_HANDLE                 hInsContext,
        char*                       ParamName,
        ULONG*                      puLong
    )
{
    //printf("Host_GetParamUlongValue %p, %s\n", hInsContext, ParamName);
    PLmObjectHost pHost = (PLmObjectHost) hInsContext;
    int i = 0;
    for(; i<LM_HOST_NumUlongPara; i++){
        if( AnscEqualString(ParamName, COSA_HOSTS_Extension1_Name, TRUE))
        {
            time_t currentTime = time(NULL);
            if(currentTime > pHost->activityChangeTime){
                *puLong = currentTime - pHost->activityChangeTime;
            }else{
                *puLong = 0;
            }
            return TRUE;
        }
        else if( AnscEqualString(ParamName, lmHosts.pHostUlongParaName[i], TRUE))
        {
            /* collect value */
            *puLong = pHost->ulUlongParaValue[i];
            return TRUE;
        }
    }
#if 0
    /* check the parameter name and return the corresponding value */
    if( AnscEqualString(ParamName, "X_CISCO_COM_DeviceType", TRUE))
    {
        /* collect value */
        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_CISCO_COM_NetworkInterface", TRUE))
    {
        /* collect value */
        return TRUE;
    }

    if( AnscEqualString(ParamName, "X_CISCO_COM_ConnectionStatus", TRUE))
    {
        /* collect value */
        return TRUE;
    }
#endif

    /* AnscTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */
    return FALSE;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:83,代码来源:cosa_hosts_dml.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AnscFreeMemory函数代码示例发布时间:2022-05-30
下一篇:
C++ AnscAllocateMemory函数代码示例发布时间: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