本文整理汇总了C++中AnscSizeOfString函数的典型用法代码示例。如果您正苦于以下问题:C++ AnscSizeOfString函数的具体用法?C++ AnscSizeOfString怎么用?C++ AnscSizeOfString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AnscSizeOfString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
}