Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ DslhCpecoRegisterObject
pParameterArray[pMyObject->uParameterArrayIndex++].dataType = ccsp_string;
else if ( !_ansc_strncmp( pParamDescr->DataType, DSLH_CWMP_DATA_NAME_int, _ansc_strlen(DSLH_CWMP_DATA_NAME_int) ))
pParameterArray[pMyObject->uParameterArrayIndex++].dataType = ccsp_int;
else if ( !_ansc_strncmp( pParamDescr->DataType, DSLH_CWMP_DATA_NAME_unsignedLong, _ansc_strlen(DSLH_CWMP_DATA_NAME_unsignedLong) ))
pParameterArray[pMyObject->uParameterArrayIndex++].dataType = ccsp_unsignedLong;
else if ( !_ansc_strncmp( pParamDescr->DataType, DSLH_CWMP_DATA_NAME_unsignedInt, _ansc_strlen(DSLH_CWMP_DATA_NAME_unsignedInt) ))
pParameterArray[pMyObject->uParameterArrayIndex++].dataType = ccsp_unsignedInt;
else if ( !_ansc_strncmp( pParamDescr->DataType, DSLH_CWMP_DATA_NAME_boolean, _ansc_strlen(DSLH_CWMP_DATA_NAME_boolean) ))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,14 @@ DslhDmagntParseObjFuncInfo
pDslhTr69If->SetEntryParamUlong = (PFN_DSLHTR69_SET_ULONG)hProc;

}
else if( strcmp(pName, COSA_XML_NODE_func_SetParamUint64Value) == 0 )
{
pDslhTr69If->SetEntryParamUint64 = (PFN_DSLHTR69_SET_UINT64)hProc;
}
else if( strcmp(pName, COSA_XML_NODE_func_GetParamUint64Value) == 0 )
{
pDslhTr69If->GetEntryParamUint64 = (PFN_DSLHTR69_GET_UINT64)hProc;
}
else if( strcmp(pName, COSA_XML_NODE_func_SetParamStringValue) == 0 )
{
pDslhTr69If->SetEntryParamString = (PFN_DSLHTR69_SET_STRING)hProc;
Expand Down Expand Up @@ -1616,6 +1624,14 @@ DslhDmagntParseRootFuncInfo
pDslhTr69If->SetEntryParamUlong = (PFN_DSLHTR69_SET_ULONG)hProc;

}
else if( strcmp(pName, COSA_XML_NODE_func_SetParamUint64Value) == 0 )
{
pDslhTr69If->SetEntryParamUint64 = (PFN_DSLHTR69_SET_UINT64)hProc;
}
else if( strcmp(pName, COSA_XML_NODE_func_GetParamUint64Value) == 0 )
{
pDslhTr69If->GetEntryParamUint64 = (PFN_DSLHTR69_GET_UINT64)hProc;
}
else if( strcmp(pName, COSA_XML_NODE_func_SetParamStringValue) == 0 )
{
pDslhTr69If->SetEntryParamString = (PFN_DSLHTR69_SET_STRING)hProc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>
/*
* If not stated otherwise in this file or this component's Licenses.txt file the
* following copyright and licenses apply:
Expand Down Expand Up @@ -355,6 +356,26 @@ DslhObjcoValidate

break;

case SLAP_VAR_SYNTAX_uint64 :

if( pInterface->SetEntryParamUint64 != NULL)
{
unsigned long long ullVal = 0;
if ( !pDslhRvqIf->GetParamValueUint64 )
{
*ppFaultParamName = AnscCloneString(pParamDescr->Name);
return FALSE;
}
ullVal = pDslhRvqIf->GetParamValueUint64(pDslhRvqIf->hOwnerContext, pParamDescr->Name);
if(!pInterface->SetEntryParamUint64(pMyObject->hInsContext, pCallingName, ullVal))
{
*ppFaultParamName = AnscCloneString(pParamDescr->Name);
return FALSE;
}
}

break;

case SLAP_VAR_SYNTAX_ucharArray :
case SLAP_VAR_SYNTAX_string :

Expand Down Expand Up @@ -1096,6 +1117,59 @@ DslhObjcoGetParamValueByName
{
bReturn = pInterface->GetEntryParamUlong(pMyObject->hInsContext,pName, &pSlapVariable->Variant.varUint32);
}
else if( pInterface->GetEntryParamUint64 != NULL)
{
/* uint32 param but only Uint64 getter registered */
ULONG64 tmp64 = 0;
bReturn = pInterface->GetEntryParamUint64(pMyObject->hInsContext, pName, &tmp64);
if (bReturn)
{
pSlapVariable->Variant.varUint32 = (SLAP_UINT32)tmp64;
}
}
else
{
AnscTraceWarning(("GetParamValueByName '%s': GetEntryParamUlong/Uint64 are NULL\n", pName));
}

if (!bReturn)
{
AnscTraceWarning(("GetParamValueByName '%s': uint32 getter returned FALSE (ptrUlong=%p ptrUint64=%p)\n",
pName,
(void*)pInterface->GetEntryParamUlong,
(void*)pInterface->GetEntryParamUint64));
}

break;

case SLAP_VAR_SYNTAX_uint64 :

if( pInterface->GetEntryParamUint64 != NULL)
{
bReturn = pInterface->GetEntryParamUint64(pMyObject->hInsContext, pName, &pSlapVariable->Variant.varUint64);
}
else if( pInterface->GetEntryParamUlong != NULL)
{
/* uint64 param but only Ulong getter registered (legacy DML) */
ULONG tmp32 = 0;
bReturn = pInterface->GetEntryParamUlong(pMyObject->hInsContext, pName, &tmp32);
if (bReturn)
{
pSlapVariable->Variant.varUint64 = (SLAP_UINT64)tmp32;
}
}
else
{
AnscTraceWarning(("GetParamValueByName '%s': GetEntryParamUint64/Ulong are NULL\n", pName));
}

if (!bReturn)
{
AnscTraceWarning(("GetParamValueByName '%s': uint64 getter returned FALSE (ptrUint64=%p ptrUlong=%p)\n",
pName,
(void*)pInterface->GetEntryParamUint64,
(void*)pInterface->GetEntryParamUlong));
}

break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ DslhObjroCreate
pDslhRvqIf->GetParamValueString = DslhObjroRvqGetParamValueString;
pDslhRvqIf->GetParamValueInt = DslhObjroRvqGetParamValueInt;
pDslhRvqIf->GetParamValueUint32 = DslhObjroRvqGetParamValueUint32;
pDslhRvqIf->GetParamValueUint64 = DslhObjroRvqGetParamValueUint64;
pDslhRvqIf->GetParamValueBool = DslhObjroRvqGetParamValueBool;
pDslhRvqIf->GetParamValueUint32Array = DslhObjroRvqGetParamValueUint32Array;
pDslhRvqIf->GetParamValueUcharArray = DslhObjroRvqGetParamValueUcharArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ DslhObjroRvqGetParamValueInt
char* pParamName
);

unsigned long long
DslhObjroRvqGetParamValueUint64
(
ANSC_HANDLE hThisObject,
char* pParamName
);

ULONG
DslhObjroRvqGetParamValueUint32
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* DslhObjroRvqGetParamValueString
* DslhObjroRvqGetParamValueInt
* DslhObjroRvqGetParamValueUint32
* DslhObjroRvqGetParamValueUint64
* DslhObjroRvqGetParamValueBool
* DslhObjroRvqGetParamValueUint32Array
* DslhObjroRvqGetParamValueUcharArray
Expand Down Expand Up @@ -398,6 +399,55 @@ DslhObjroRvqGetParamValueInt

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


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

caller: owner of this object

prototype:

unsigned long long
DslhObjroRvqGetParamValueUint64
(
ANSC_HANDLE hThisObject,
char* pParamName
);

description:

Retrieve modified unsignedLong / uint64 parameter value.

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

unsigned long long
DslhObjroRvqGetParamValueUint64
(
ANSC_HANDLE hThisObject,
char* pParamName
)
{
PDSLH_OBJ_RECORD_OBJECT pMyObject = (PDSLH_OBJ_RECORD_OBJECT)hThisObject;
PSLAP_VARIABLE pParamValue = (PSLAP_VARIABLE )NULL;
PDSLH_RVQ_INTERFACE pDslhRvqIf = (PDSLH_RVQ_INTERFACE )pMyObject->hDslhRvqIf;

pParamValue =
(PSLAP_VARIABLE)pDslhRvqIf->GetParamValue
(
(ANSC_HANDLE)pMyObject,
pParamName
);

if ( !pParamValue )
{
return 0;
}

if ( pParamValue->Syntax == SLAP_VAR_SYNTAX_uint64 )
return (unsigned long long)pParamValue->Variant.varUint64;

return (unsigned long long)pParamValue->Variant.varUint32;
}

ULONG
DslhObjroRvqGetParamValueUint32
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ DslhVarroGetValue
{
pSlapVariable->Variant.varUint32 = 0;
}
else if( pSlapVariable->Syntax == SLAP_VAR_SYNTAX_uint64)
{
pSlapVariable->Variant.varUint64 = 0;
}
}
}

Expand Down Expand Up @@ -332,6 +336,14 @@ DslhVarroGetValue

break;

case SLAP_VAR_SYNTAX_uint64 :

pSlapVariable->Variant.varUint64 =
((PFN_DSLHPARAM_GET_UINT64)pfnGetValueMethod)
((ANSC_HANDLE)pObjController);

break;

case SLAP_VAR_SYNTAX_uint32Array :

pSlapVariable->Variant.varUint32Array =
Expand Down Expand Up @@ -664,6 +676,20 @@ DslhVarroTstValue

break;

case DSLH_CWMP_DATA_TYPE_unsignedLong :

/* TR-181 unsignedLong is slap uint64 only (dmcli ulong). */
if ( pNewValue->Syntax != SLAP_VAR_SYNTAX_uint64 )
{
return FALSE;
}
if ( pNewValue->Variant.varUint64 < (SLAP_UINT64)pVarEntity->FormatValue1 )
{
return FALSE;
}

break;

case DSLH_CWMP_DATA_TYPE_boolean :

if ( (pNewValue->Syntax != SLAP_VAR_SYNTAX_bool ) &&
Expand Down Expand Up @@ -712,7 +738,31 @@ DslhVarroTstValue
* (digits 0-9, letters A-F or a-f) displayed as six pairs of digits separated
* by colons.
*/
if ( pVarEntity->ContentType == SLAP_CONTENT_TYPE_UNSPECIFIED )
/*
* TR-181 unsignedLong uses ContentType UNSIGNED_LONG + slap uint64.
* Handle it alone so it never falls into the string ContentType path
* (that path's default returns FALSE → invalid parameter value).
*/
if ( pVarEntity->ContentType == SLAP_CONTENT_TYPE_UNSIGNED_LONG )
{
if ( !bTestBypass )
{
if ( pNewValue->Syntax == SLAP_VAR_SYNTAX_uint64 )
{
bTestResult =
((PFN_DSLHPARAM_TST_UINT64)pfnTstValueMethod)
(
(ANSC_HANDLE)pObjController,
pNewValue->Variant.varUint64
);
}
else
{
bTestResult = FALSE;
}
}
}
else if ( pVarEntity->ContentType == SLAP_CONTENT_TYPE_UNSPECIFIED )
{
switch ( pVarEntity->Syntax )
{
Expand Down Expand Up @@ -786,6 +836,18 @@ DslhVarroTstValue

break;

case SLAP_VAR_SYNTAX_uint64 :

if ( !bTestBypass )
{
bTestResult =
((PFN_DSLHPARAM_TST_UINT64)pfnTstValueMethod)
((ANSC_HANDLE)pObjController,
pNewValue->Variant.varUint64);
}

break;

case SLAP_VAR_SYNTAX_handle :

if ( !bTestBypass )
Expand Down Expand Up @@ -1314,7 +1376,16 @@ DslhVarroSetValue
*/


if ( pVarEntity->ContentType == SLAP_CONTENT_TYPE_UNSPECIFIED )
if ( pVarEntity->ContentType == SLAP_CONTENT_TYPE_UNSIGNED_LONG )
{
returnStatus =
((PFN_DSLHPARAM_SET_UINT64)pfnSetValueMethod)
(
(ANSC_HANDLE)pObjController,
pNewValue->Variant.varUint64
);
}
else if ( pVarEntity->ContentType == SLAP_CONTENT_TYPE_UNSPECIFIED )
{
switch ( pVarEntity->Syntax )
{
Expand Down Expand Up @@ -1373,6 +1444,17 @@ DslhVarroSetValue

break;

case SLAP_VAR_SYNTAX_uint64 :

returnStatus =
((PFN_DSLHPARAM_SET_UINT64)pfnSetValueMethod)
(
(ANSC_HANDLE)pObjController,
pNewValue->Variant.varUint64
);

break;

case SLAP_VAR_SYNTAX_handle :

returnStatus =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,19 @@ DslhWmpdoMpaSetParameterValues
break;
}
}
else if( dataType == DSLH_CWMP_DATA_TYPE_unsignedLong)
{
if( pParameterValueArray[i].Value->Syntax != SLAP_VAR_SYNTAX_uint64)
{
bFaultEncountered = TRUE;

*ppInvalidParameterName = AnscCloneString(pParameterValueArray[i].Name);

returnStatus = CCSP_ERR_INVALID_PARAMETER_TYPE;

break;
}
}
else
{
if( pParameterValueArray[i].Value->Syntax != SLAP_VAR_SYNTAX_string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ DslhWmpdoMprRegParameter

// Assign appropriate ContentType for 'dateTime', or the object type will default to 'string'. RTian 2013/11/11
if(pVarEntity->DataType == DSLH_CWMP_DATA_TYPE_dateTime) pVarEntity->ContentType = SLAP_CONTENT_TYPE_CALENDAR_TIME;
if(pVarEntity->DataType == DSLH_CWMP_DATA_TYPE_unsignedLong)
{
pVarEntity->Syntax = SLAP_VAR_SYNTAX_uint64;
pVarEntity->ContentType = SLAP_CONTENT_TYPE_UNSIGNED_LONG;
}

if ( pParamEnumTokens )
{
Expand Down
Loading
Loading