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);
Definition: ProtocolType.h:21
uint8_t * getLayerPayload()
Definition: Layer.h:106
virtual void parseNextLayer()=0
void copyData(uint8_t *toArr)
virtual size_t getHeaderLen()=0
size_t getDataLen()
Definition: Layer.h:101
ProtocolType getProtocol()
Definition: Layer.h:91
virtual OsiModelLayer getOsiModelLayer()=0
uint8_t * getData()
Definition: Layer.h:96
OsiModelLayer
Definition: ProtocolType.h:213
bool isAllocatedToPacket()
Definition: Layer.h:121
virtual void computeCalculateFields()=0
Layer * getNextLayer()
Definition: Layer.h:81
ProtocolType
Definition: ProtocolType.h:16
virtual uint8_t * getDataPtr(size_t offset=0)=0
uint8_t * getDataPtr(size_t offset=0)
Definition: Layer.h:132
Layer * getPrevLayer()
Definition: Layer.h:86
size_t getLayerPayloadSize()
Definition: Layer.h:111
The main namespace for the PcapPlusPlus lib.
virtual std::string toString()=0