31 virtual uint8_t*
getDataPtr(
size_t offset = 0) = 0;
96 inline uint8_t*
getData() {
return m_Data; }
132 uint8_t*
getDataPtr(
size_t offset = 0) {
return (uint8_t*)(m_Data + offset); }
169 bool m_IsAllocatedInPacket;
171 Layer() : m_Data(NULL), m_DataLen(0), m_Packet(NULL), m_Protocol(
UnknownProtocol), m_NextLayer(NULL), m_PrevLayer(NULL), m_IsAllocatedInPacket(false) { }
173 Layer(uint8_t* data,
size_t dataLen, Layer* prevLayer, Packet* packet) :
174 m_Data(data), m_DataLen(dataLen),
176 m_NextLayer(NULL), m_PrevLayer(prevLayer), m_IsAllocatedInPacket(false) {}
179 Layer(
const Layer& other);
180 Layer& operator=(
const Layer& other);
182 inline void setNextLayer(Layer* nextLayer) { m_NextLayer = nextLayer; }
183 inline void setPrevLayer(Layer* prevLayer) { m_PrevLayer = prevLayer; }
185 virtual bool extendLayer(
int offsetInLayer,
size_t numOfBytesToExtend);
186 virtual bool shortenLayer(
int offsetInLayer,
size_t numOfBytesToShorten);
bool isAllocatedToPacket()
Definition: Layer.h:121
uint8_t * getLayerPayload()
Definition: Layer.h:106
size_t getDataLen()
Definition: Layer.h:101
The main namespace for the PcapPlusPlus lib.
Layer * getNextLayer()
Definition: Layer.h:81
Definition: ProtocolType.h:21
size_t getLayerPayloadSize()
Definition: Layer.h:111
uint8_t * getData()
Definition: Layer.h:96
OsiModelLayer
Definition: ProtocolType.h:208
virtual size_t getHeaderLen()=0
uint8_t * getDataPtr(size_t offset=0)
Definition: Layer.h:132
virtual void computeCalculateFields()=0
ProtocolType getProtocol()
Definition: Layer.h:91
ProtocolType
Definition: ProtocolType.h:16
void copyData(uint8_t *toArr)
virtual uint8_t * getDataPtr(size_t offset=0)=0
Layer * getPrevLayer()
Definition: Layer.h:86
virtual std::string toString()=0
virtual OsiModelLayer getOsiModelLayer()=0
virtual void parseNextLayer()=0