|
|
|
@ -1688,9 +1688,9 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_
|
|
|
|
|
ReportBuffer* buffer = reportControl->reportBuffer;
|
|
|
|
|
|
|
|
|
|
/* calculate size of complete buffer entry */
|
|
|
|
|
int bufferEntrySize = sizeof(ReportBufferEntry);
|
|
|
|
|
int bufferEntrySize = MemoryAllocator_getAlignedSize(sizeof(ReportBufferEntry));
|
|
|
|
|
|
|
|
|
|
int inclusionFieldSize = MmsValue_getBitStringByteSize(reportControl->inclusionField);
|
|
|
|
|
int inclusionFieldSize = MemoryAllocator_getAlignedSize(MmsValue_getBitStringByteSize(reportControl->inclusionField));
|
|
|
|
|
|
|
|
|
|
MmsValue inclusionFieldStatic;
|
|
|
|
|
|
|
|
|
@ -1708,7 +1708,7 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_
|
|
|
|
|
for (i = 0; i < MmsValue_getBitStringSize(reportControl->inclusionField); i++) {
|
|
|
|
|
assert(dataSetEntry != NULL);
|
|
|
|
|
|
|
|
|
|
bufferEntrySize += 1; /* reason-for-inclusion */
|
|
|
|
|
bufferEntrySize += MemoryAllocator_getAlignedSize(1); /* reason-for-inclusion */
|
|
|
|
|
|
|
|
|
|
bufferEntrySize += MmsValue_getSizeInMemory(dataSetEntry->value);
|
|
|
|
|
|
|
|
|
@ -1723,7 +1723,7 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_
|
|
|
|
|
for (i = 0; i < MmsValue_getBitStringSize(reportControl->inclusionField); i++) {
|
|
|
|
|
|
|
|
|
|
if (reportControl->inclusionFlags[i] != REPORT_CONTROL_NONE) {
|
|
|
|
|
bufferEntrySize += 1; /* reason-for-inclusion */
|
|
|
|
|
bufferEntrySize += MemoryAllocator_getAlignedSize(1); /* reason-for-inclusion */
|
|
|
|
|
|
|
|
|
|
assert(reportControl->bufferedDataSetValues[i] != NULL);
|
|
|
|
|
|
|
|
|
@ -1946,12 +1946,9 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_
|
|
|
|
|
else
|
|
|
|
|
entry->flags = 0;
|
|
|
|
|
|
|
|
|
|
if ((bufferEntrySize % sizeof(void*)) > 0)
|
|
|
|
|
bufferEntrySize = sizeof(void*) * ((bufferEntrySize + sizeof(void*) - 1) / sizeof(void*));
|
|
|
|
|
entry->entryLength = MemoryAllocator_getAlignedSize(bufferEntrySize);
|
|
|
|
|
|
|
|
|
|
entry->entryLength = bufferEntrySize;
|
|
|
|
|
|
|
|
|
|
entryBufPos += sizeof(ReportBufferEntry);
|
|
|
|
|
entryBufPos += MemoryAllocator_getAlignedSize(sizeof(ReportBufferEntry));
|
|
|
|
|
|
|
|
|
|
if (isIntegrity || isGI) {
|
|
|
|
|
DataSetEntry* dataSetEntry = reportControl->dataSet->fcdas;
|
|
|
|
@ -1963,7 +1960,7 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_
|
|
|
|
|
assert(dataSetEntry != NULL);
|
|
|
|
|
|
|
|
|
|
*entryBufPos = (uint8_t) reportControl->inclusionFlags[i];
|
|
|
|
|
entryBufPos++;
|
|
|
|
|
entryBufPos += MemoryAllocator_getAlignedSize(1);
|
|
|
|
|
|
|
|
|
|
entryBufPos = MmsValue_cloneToBuffer(dataSetEntry->value, entryBufPos);
|
|
|
|
|
|
|
|
|
@ -1985,7 +1982,7 @@ enqueueReport(ReportControl* reportControl, bool isIntegrity, bool isGI, uint64_
|
|
|
|
|
assert(reportControl->bufferedDataSetValues[i] != NULL);
|
|
|
|
|
|
|
|
|
|
*entryBufPos = (uint8_t) reportControl->inclusionFlags[i];
|
|
|
|
|
entryBufPos++;
|
|
|
|
|
entryBufPos += MemoryAllocator_getAlignedSize(1);
|
|
|
|
|
|
|
|
|
|
entryBufPos = MmsValue_cloneToBuffer(reportControl->bufferedDataSetValues[i], entryBufPos);
|
|
|
|
|
|
|
|
|
@ -2078,7 +2075,7 @@ sendNextReportEntry(ReportControl* self)
|
|
|
|
|
MmsValue* inclusionField = &inclusionFieldStack;
|
|
|
|
|
|
|
|
|
|
if (report->flags == 0)
|
|
|
|
|
currentReportBufferPos += MmsValue_getBitStringByteSize(inclusionField);
|
|
|
|
|
currentReportBufferPos += MemoryAllocator_getAlignedSize(MmsValue_getBitStringByteSize(inclusionField));
|
|
|
|
|
else {
|
|
|
|
|
inclusionFieldStack.value.bitString.buf =
|
|
|
|
|
(uint8_t*) MemoryAllocator_allocate(&ma, MmsValue_getBitStringByteSize(inclusionField));
|
|
|
|
@ -2244,7 +2241,7 @@ sendNextReportEntry(ReportControl* self)
|
|
|
|
|
for (i = 0; i < self->dataSet->elementCount; i++) {
|
|
|
|
|
|
|
|
|
|
if (report->flags > 0) {
|
|
|
|
|
currentReportBufferPos++;
|
|
|
|
|
currentReportBufferPos += MemoryAllocator_getAlignedSize(1);;
|
|
|
|
|
if (MemAllocLinkedList_add(reportElements, currentReportBufferPos) == NULL)
|
|
|
|
|
goto return_out_of_memory;
|
|
|
|
|
|
|
|
|
@ -2252,7 +2249,7 @@ sendNextReportEntry(ReportControl* self)
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (MmsValue_getBitStringBit(inclusionField, i)) {
|
|
|
|
|
currentReportBufferPos++;
|
|
|
|
|
currentReportBufferPos += MemoryAllocator_getAlignedSize(1);;
|
|
|
|
|
if (MemAllocLinkedList_add(reportElements, currentReportBufferPos) == NULL)
|
|
|
|
|
goto return_out_of_memory;
|
|
|
|
|
currentReportBufferPos += MmsValue_getSizeInMemory((MmsValue*) currentReportBufferPos);
|
|
|
|
@ -2289,7 +2286,7 @@ sendNextReportEntry(ReportControl* self)
|
|
|
|
|
if (MemAllocLinkedList_add(reportElements, reason) == NULL)
|
|
|
|
|
goto return_out_of_memory;
|
|
|
|
|
|
|
|
|
|
currentReportBufferPos++;
|
|
|
|
|
currentReportBufferPos += MemoryAllocator_getAlignedSize(1);
|
|
|
|
|
|
|
|
|
|
MmsValue* dataSetElement = (MmsValue*) currentReportBufferPos;
|
|
|
|
|
|
|
|
|
@ -2324,7 +2321,7 @@ sendNextReportEntry(ReportControl* self)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
currentReportBufferPos++;
|
|
|
|
|
currentReportBufferPos += MemoryAllocator_getAlignedSize(1);
|
|
|
|
|
|
|
|
|
|
MmsValue* dataSetElement = (MmsValue*) currentReportBufferPos;
|
|
|
|
|
|
|
|
|
|