1 #ifndef PACKETPP_TLV_DATA 2 #define PACKETPP_TLV_DATA 48 if (recordRawData == NULL)
61 m_Data = other.m_Data;
76 m_Data = other.m_Data;
88 if (m_Data == rhs.m_Data)
97 return (memcmp(m_Data, rhs.m_Data,
getTotalSize()) == 0);
114 bool isNull() {
return (m_Data == NULL); }
147 memcpy(&result, m_Data->
recordValue + offset,
sizeof(T));
166 memcpy(m_Data->
recordValue + valueOffset, &newValue,
sizeof(T));
188 template<
typename TLVRecordType>
192 size_t m_RecordCount;
206 m_RecordCount = other.m_RecordCount;
220 m_RecordCount = other.m_RecordCount;
236 return TLVRecordType(NULL);
238 return TLVRecordType(tlvDataBasePtr);
250 TLVRecordType
getNextTLVRecord(TLVRecordType& record, uint8_t* tlvDataBasePtr,
size_t tlvDataLen)
253 return TLVRecordType(NULL);
256 if ((record.getRecordBasePtr() - tlvDataBasePtr) < 0)
257 return TLVRecordType(NULL);
260 if (record.getRecordBasePtr() - tlvDataBasePtr + (int)record.getTotalSize() >= (int)tlvDataLen)
261 return TLVRecordType(NULL);
263 return TLVRecordType(record.getRecordBasePtr() + record.getTotalSize());
274 TLVRecordType
getTLVRecord(uint8_t recordType, uint8_t* tlvDataBasePtr,
size_t tlvDataLen)
277 while (!curRec.isNull())
279 if (curRec.getType() == recordType)
285 return TLVRecordType(NULL);
299 if (m_RecordCount != (
size_t)-1)
300 return m_RecordCount;
304 while (!curRec.isNull())
310 return m_RecordCount;
339 TLVRecordBuilder(uint8_t recType,
const uint8_t* recValue, uint8_t recValueLen);
355 void init(uint8_t recType,
const uint8_t* recValue, uint8_t recValueLen);
358 uint8_t m_RecValueLen;
362 #endif // PACKETPP_TLV_DATA uint8_t * getRecordBasePtr()
Definition: TLVData.h:124
uint8_t recordLen
Definition: TLVData.h:33
void changeTLVRecordCount(int changedBy)
Definition: TLVData.h:320
uint8_t recordType
Definition: TLVData.h:31
uint8_t * getValue()
Definition: TLVData.h:109
TLVRecordType getFirstTLVRecord(uint8_t *tlvDataBasePtr, size_t tlvDataLen)
Definition: TLVData.h:232
Definition: TLVData.h:333
bool isNotNull()
Definition: TLVData.h:119
T getValueAs(size_t offset=0)
Definition: TLVData.h:141
uint8_t recordValue[]
Definition: TLVData.h:35
Definition: IpAddress.h:113
virtual ~TLVRecord()
Definition: TLVData.h:67
TLVRecordType getTLVRecord(uint8_t recordType, uint8_t *tlvDataBasePtr, size_t tlvDataLen)
Definition: TLVData.h:274
TLVRecordType getNextTLVRecord(TLVRecordType &record, uint8_t *tlvDataBasePtr, size_t tlvDataLen)
Definition: TLVData.h:250
void purgeRecordData()
Definition: TLVData.h:129
size_t getTLVRecordCount(uint8_t *tlvDataBasePtr, size_t tlvDataLen)
Definition: TLVData.h:297
bool isNull()
Definition: TLVData.h:114
uint8_t getType()
Definition: TLVData.h:104
Definition: TLVData.h:189
TLVRecordReader(const TLVRecordReader &other)
Definition: TLVData.h:204
virtual size_t getTotalSize() const =0
TLVRecordReader & operator=(const TLVRecordReader &other)
Definition: TLVData.h:218
bool setValue(T newValue, int valueOffset=0)
Definition: TLVData.h:161
TLVRecordReader()
Definition: TLVData.h:199
virtual ~TLVRecordReader()
Definition: TLVData.h:212
TLVRecord(const TLVRecord &other)
Definition: TLVData.h:59
The main namespace for the PcapPlusPlus lib.
virtual size_t getDataSize()=0
bool operator==(const TLVRecord &rhs)
Definition: TLVData.h:86
TLVRecord & operator=(const TLVRecord &other)
Definition: TLVData.h:74
TLVRecord(uint8_t *recordRawData)
Definition: TLVData.h:46